package com.test.resumeanalysis.ui.post

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.test.resumeanalysis.App.App
import com.test.resumeanalysis.data.model.JobPost
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class PostViewModel :ViewModel(){

    private val jobPostDao = App.dataBase.jobPostDao()


    private val mutableLiveData  = MutableLiveData<String>()
    val liveData = mutableLiveData

    fun savePost(jobPost: JobPost){
        CoroutineScope(Dispatchers.IO).launch {
            jobPostDao.insertData(jobPost)
        }
    }

}